-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Towing vehicles #34690
Towing vehicles #34690
Conversation
Oh, wow. WOW |
Can you chain them and have another car being pulled by the pulled vehicle or is it limited to just 1? |
Currently if a vehicle is either a tower, or a towed, then you cant attach another cable to it, I did this deliberately to keep things simple. But I guess a towee, could also be a tower, and theoretically yes it could chain. Id be wary of it though, it would multiply the chances for things to go wrong. |
Will anything funny happen when #33829 gets merged and you tie a car to a helicopter? |
Quite likely very strange things would happen. |
Rebased to latest changes in #34616 |
Does the towed vehicle keep its momentum when the tower suddenly hits on the breaks or does it also stop immediately? |
Theres no momentum, the towed vehicle is kinda driving itself, and when the distance gets less than a certain number, then it stops moving. So no hard braking and having thw towed vehicle ram into you, not yet anyway :) |
Hell yeah! Good job. |
Could you please add tow cable to the list of possible alternatives of rope in butchering activity? |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ code looks good. Just need to beef up the towing line - this is 50' of 1" stick cable that can tow roughly 100,000 lbs, which is sufficiently close to "unlimited weight".
When you go back and add some weight limits, we can add some lighter tow cable and some tow lines and/or ropes.
It looks great to finally see the concept in game. It feels a bit wrong though:
|
This is a different route to the same end-goal, what feels wrong exactly? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered. |
aa39539
to
9761f13
Compare
924f105
to
39e00e3
Compare
Applied this to my local game, and had my deathmobile tow a 4x4. Worked great on roads, but as soon as I got off-road, my deathmobile continued (slowly), but the vehicle it was towing did not. The deathmobile isn't built for off-road use, so I suspect the weight of both vehicles combined exceeded its engine capacity. However in that case I'd expect the towing vehicle to stop, not the vehicle being towed. Otherwise this is great. An excellent change for folks who have multiple vehicles and like to relocate. Thank you! |
ad63e77
to
8e68539
Compare
621a68e
to
b7106d0
Compare
0f30a43
to
d432807
Compare
add UI and sound cues for autopilot, and rework collision detection remove test code simple towin WIP Update src/iuse.cpp Co-Authored-By: Curtis Merrill <curtis.r.merrill@gmail.com> increase cable length, and enable serialization/validation of tow data in-progress - invalidate towing and dump cable part add handling to clear towing data on part/vehicle destruction or too much distnace json lint make recipe use metal cables transfer tow data when vehicle splits DEATH TO AUTO change breaks_into to use new metal recipe from review: add tow cable to butchery hanging options from review : change recipe to be HD cable replace item groups entries for tow_cable with hd_tow_cable json typo clang-tidy satisfaction - redundant bool return and differing paramters add cable to recipe make towing aware of side it is pulled from for reverse pulling
Rebased, cleaned up, tested, working. Im not sure why the tower is allowed to proceed at velocity 1, when the towed vehicle stops at velocity 1. I managed to repro this with a bus pulling a bus, and they went off-road, this would be a situation where probably it would be impossible to get traction, so ive detected this scenario and added a message similar to when a vehicle is too heavy for its engines. Pulling a golf cart with a military cargo truck off-road didnt have this problem, it managed to stay above 1mph. |
How do you detach the tow cable? I had to deconstruct the towed vechicle which resulted in the tow cable disappearing. |
Try examining vehicle tile with tow attachment. |
Summary
SUMMARY: Features "Towing vehicles"
Purpose of change
Allows you to tow a vehicle with another one, by attaching a tow-line.
this relies on some of the changes in #34616 , and therefore has those commits too.
Describe the solution
Add an item that is similar to charging cable in how it attaches to a vehicle.
When it attaches it sets references to each vehicle to the other, when the puller moves, the pulled vehicle moves too.
Describe alternatives you've considered
N/A
Testing
Still to do :-
1)saving/loading - DONE
2)currently there are pointers stored on each vehicle, these need to be managed with care to ensure they are removed and not left dangling when certain things happen - such as destruction of a vehicle, destruction of the tow line part etc. - DONE
3)Make the tow-line have more than 3 "charges" so it can be spooled further out. - DONE
4) tweak the code that makes it follow closely, so that it is smarter. - DONE
5) handle vehicle getting unloaded out of reality bubble etc. - DONE
6)add weight to the pulling vehicle to represent the added strain of the pulled vehicles weight. - DONE
7) if pulled vehicle has no wheels, make it skid? make it create shallow pits in the ground? - THIS ALREADY HAPPENS AUTOMATICALLY
8) need to handle obstacles interfering with the pulled vehicle, or when too much distance opens up between the vehicles. or when the pulled vehicle is driven away ( need to make it bidirectional somehow maybe? ) - DONE
9) spawn in various places, make it craftable. - DONE
current limitations :
The order in which you apply the cable matters, first vehicle selected is the puller, second is the pulled, Ima see if I can work around that.
It really is better if you attach the tow-line to the rear of the puller, and the front of the pulled.
Otherwise weird things may happen.
Additional context
A gif of it -
https://gfycat.com/disguisedweepyladybug